<?php

	// +----------------------------------------------------------------------
	// | 建议反馈
	// +----------------------------------------------------------------------
	// | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
	// +----------------------------------------------------------------------
	// | Author: 微尘 <yicmf@qq.com>
	// +----------------------------------------------------------------------

	namespace app\model\ucenter;

	use app\model\file\Image;

	class Feedback extends Common
	{

        protected $name='feed_back';

		public function user()
		{
			return $this->belongsTo(User::class);
		}

		/**
		 * 写入修改
		 * @param $data
		 */
		public static function onBeforeInsert($data)
		{
			$data['status'] = 1;
			$data['ip'] = request()->ip();
		}

		// 设置json类型字段
//		protected $json = ['images'];
//		protected $type = ['images'=>'array'];

//		// 设置JSON数据返回数组
//		protected $jsonAssoc = true;
//
//	public function getImagesAttr($value)
//	{
//		return Image::where('id','in',$value)->select();
//	}
		protected $type = [
			'images'      =>  'array',
		];
	}
